#include <allegro.h>
#include <stdio.h>
#include <stdlib.h>

int timer;
BITMAP *buffer;
void my_time() {
	timer++;
}
int main() {
	char timer_to_s[100];
	allegro_init();
	install_timer();
	install_keyboard();
	set_color_depth(24);
	set_gfx_mode(GFX_AUTODETECT_WINDOWED, 800, 600, 0, 0);
	buffer = create_bitmap(800, 600);
	install_int(my_time, 1000);
while(!key[KEY_ESC]) {
		acquire_screen();
		sprintf(timer_to_s, "%d", timer);
		clear_to_color(buffer, makecol(255, 255, 255));
		textout_ex( buffer, font, timer_to_s, 50, 250, makecol(0, 0, 0), -1);
		draw_sprite(screen, buffer, 0, 0);
		release_screen();
	}
	return 0;
}